package com.edais.util;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.core.io.support.PropertiesLoaderUtils;

import java.util.Properties;

/**
 * Jwt配置 Created by haoyx on 2017/2/6.
 */
public class Config {

	private static final Log logger = LogFactory.getLog(Config.class);

	public static String TOKEN_HMAC256_KEY;
	public static String APP_SIGN_MD5_KEY;
	public static String APP_DATA_DES3_SECRET_KEY;
	public static String APP_DATA_DES3_VI;
	static {
		try {
			Properties props = PropertiesLoaderUtils.loadAllProperties("config.properties");
			TOKEN_HMAC256_KEY = props.getProperty("token.hmac256.key");
			APP_SIGN_MD5_KEY = props.getProperty("app.sign.md5.key");
			APP_DATA_DES3_SECRET_KEY = props.getProperty("app.data.des3.secret.key");
			APP_DATA_DES3_VI = props.getProperty("app.data.des3.iv");
		} catch (Exception e) {
			logger.error("读取config.properties失败", e);
		}
	}
}